#ifndef TCP_H
#define TCP_H

#include <QWidget>
#include <QTcpServer>
#include <QTcpSocket>

namespace Ui {
class TCP;
}

class TCP : public QWidget
{
	Q_OBJECT

public:
	explicit TCP(QWidget *parent = nullptr);
	~TCP();

private slots:
	void on_pushButton_server_send_clicked();

	void on_pushButton_server_close_clicked();

	void on_pushButton_client_connect_clicked();

	void on_pushButton_client_send_clicked();

	void on_pushButton_client_close_clicked();

private:
	Ui::TCP *ui;

	bool bind_button = false;
	QTcpServer * tcp_server = nullptr;
	QTcpSocket * tcp_server_socket = nullptr;
	bool tcp_client = false;
	QTcpSocket * tcp_client_socket = nullptr;
};

#endif // TCP_H
